import './assets/main.css'

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import 'font-awesome/css/font-awesome.min.css'
import Footer from './components/Footer.vue'
import { getSessionStorage,setSessionStorage,removeSessionStorage } from './common.js'

router.beforeEach(function (to, from, next) { 
    let user = getSessionStorage('jinandaxueuser');
    
    if(!(to.path=='/' || to.path=='/login')){
        if(user==null){
            router.push('/login');
            return;
        }
    }

    next();

})

const app = createApp(App)

app.use(router)

app.component('Footer',Footer).mount('#app')
